package configuration.dataObjects
{
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class WaveFlowHeaderDO
	{
		public var WAVE_FLOW:String = "";
		public var DESCRIPTION:String = "";
		public var ACTIVE:String = "Y";
		public var OBJECT_ID:Number = 0;
		public var CREATE_TASK:String = "Y";
		
		public function WaveFlowHeaderDO()
		{
		}

		public function Init(xmlObj:XML):void{				
			if(null == xmlObj)
				return;
			else{
				for each (var itemProp:XML in xmlObj.children()) {			
					this[itemProp.name()] = itemProp;
				}
			}
		}
		
		public function ToXML():XML{
			var xmlObj:XML =
				<WAVE_FLOW_HEADER>
					<WAVE_FLOW>{WAVE_FLOW}</WAVE_FLOW>
					<DESCRIPTION>{DESCRIPTION}</DESCRIPTION>
					<ACTIVE>{ACTIVE}</ACTIVE>
					<OBJECT_ID>{OBJECT_ID}</OBJECT_ID>
					<CREATE_TASK>{CREATE_TASK}</CREATE_TASK>
				</WAVE_FLOW_HEADER>;
			return xmlObj;
		}
		
		public static function getItems(list:XMLList):ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection();
			for each(var xml:XML in list)
			{
				var itm:WaveFlowHeaderDO = new WaveFlowHeaderDO();
				itm.Init(xml);
				ac.addItem(itm);
			}
			return ac;
		}
	}
}